package cn.tedu.live8.controller;

import cn.tedu.live8.pojo.vo.ShoppingIndexVO;
import cn.tedu.live8.service.ShoppingIndexService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/shoppingindex")
public class ShoppingIndexController {
    @Autowired
    private ShoppingIndexService shoppingIndexService;

    //获取到所有产品信息
    @GetMapping("/product/select")
    public List<ShoppingIndexVO> getProductList() {
        List<ShoppingIndexVO> ShoppingIndexList = shoppingIndexService.list();
        log.debug("开始执行ShoppomhIndex页面对应的Controller,并返回页面数据:{}", ShoppingIndexList);
        return ShoppingIndexList;
    }

}
